<?php

/**
 * @Author: zhibinm (113664000@qq.com)
 * @Date:   2018-04-11 10:47:20 
 * @Copyright:   xuebingsi
 * @Last Modified by:   Zhibinm
 * @Last Modified time: 2018-04-11 11:35:07
 */

$data = file_get_contents('./db.txt');

var_dump(json_decode($data,true));


$arr = ['username'=>'xuebingsi','age'=>18];


// // 数据结构  字符串形式  json 
$str = json_encode($arr);


file_put_contents('./db.txt',$str);